class CreateChoices < ActiveRecord::Migration
  def self.up
    create_table :choices do |t|
      t.integer   :stu_id
      t.integer   :tea_id
      t.string    :stu_status
      t.string    :tea_status
      t.timestamps
    end
    execute "alter table choices
               add constraint fk_choice_students
               foreign key  (stu_id) references students(id)"
    execute "alter table choices
               add constraint fk_choice_teachers
               foreign key  (tea_id) references teachers(id)"
  end

  def self.down
    drop_table :choices
  end
end
